package com.guochenglang.www.pojo;

import com.guochenglang.www.pojo.annotate.Table;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * 知识库表
 *
 * @author 郭程朗
 */
@Table("base")
public class Base {
    /**
     * 主键
     */
    private Integer id;
    /**
     * 知识库名字
     */
    private String name;
    /**
     * 知识库简介
     */
    private String brief;
    /**
     * 创建时间
     */
    private Timestamp creatTime;
    /**
     * 创建者id
     */
    private Integer createrId;
    /**
     * 知识库状态
     */
    private Integer isPublic;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Base base = (Base) o;
        return Objects.equals(id, base.id) && Objects.equals(name, base.name) && Objects.equals(brief, base.brief) && Objects.equals(creatTime, base.creatTime) && Objects.equals(createrId, base.createrId) && Objects.equals(isPublic, base.isPublic);
    }

    @Override
    public String toString() {
        return "Base{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", brief='" + brief + '\'' +
                ", creatTime=" + creatTime +
                ", createrId=" + createrId +
                ", isPublic=" + isPublic +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, brief, creatTime, createrId, isPublic);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic;
    }

    public Integer getCreaterId() {
        return createrId;
    }

    public void setCreaterId(Integer createrId) {
        this.createrId = createrId;
    }

    public Timestamp getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Timestamp creatTime) {
        this.creatTime = creatTime;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Base(Integer id, String name, Integer createrId, Timestamp creatTime, Integer isPublic, String brief) {
        this.id = id;
        this.name = name;
        this.createrId = createrId;
        this.creatTime = creatTime;
        this.isPublic = isPublic;
        this.brief = brief;
    }

    public Base() {
    }
}
